package cn.gok.testgit;
class SuperWorker extends Worker{
    private float bonus;


    public SuperWorker(String name, String job, int salary,float bonus) {
        super(name, job, salary);
        this.bonus=bonus;
    }

    @Override
    public int doJob(int months) {
        if (this.bonus > 0 && this.bonus < 1) {
            return (int) (this.getSalary()*(1+this.bonus));
        }else{
            return 0;
        }
    }
    public int doJob(int months,int addtionalHours){

        return (int) (this.getSalary()+bonus*getSalary()*addtionalHours/100);
    }
}
public  class test2{
    public static void main(String[] args) {
        SuperWorker superWorker =new SuperWorker("陈小宝","java",5000,0.6f);
        superWorker.doJob(12);
        superWorker.doJob(12,12);
        System.out.println(superWorker.doJob(12));
        System.out.println(superWorker.doJob(12,50));

    }
}